package com.micro.center.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.micro.center.entity.SysRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author pan.shun
 * @since 2022/7/5 17:00
 */
@Repository
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRoleEntity> {

    /**
     * 通过用户ID 查找角色
     *
     * @param userId 用户id
     */
    List<String> getRoleListByUserId(@Param("userId") String userId);

    /**
     * 通过用户名查找角色
     *
     * @param userId 用户ID
     */
    List<String> getRoleNameByUserId(@Param("userId") String userId);
}
